import { createRouter, createWebHashHistory, RouteRecordRaw} from 'vue-router'

import Home from '@/views/home/index.vue'
import AdminIndex from '@/views/admin/index.vue'
import List from '@/views/admin/list.vue'
import Add from '@/views/admin/add.vue'
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/admin',
    name: 'AdminIndex',
    component: AdminIndex,
    children: [
      {
        path: '/admin/list',
        name: 'list',
        component: List
      },
      {
        path: '/admin/add',
        name: 'Add',
        component: Add
      }
    ]
  }
  
]
const router = createRouter({
  history: createWebHashHistory(),
  routes
})
export default router